<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <!-- var year = 2016
var month = 2
var day = 11 -->
<!-- 根据输入的三个数字，判断是这一年的第几天 -->
<script>
    var year=parseInt( prompt("请输入你的年份"));
    var month=parseInt( prompt("请输入你的月份"));
    var day=parseInt( prompt("请输入你的天数"));
    var date=0;
    date==day;
switch(month){
    case 12:date+=30;
case 11:date+=31;
case 10:date+=30;
case 9:date+=31;
case 8:date+=31;
case 7:date+=30;
case 6:date+=31;
case 5:date+=30;
case 4:date+=31;
case 3:
if(year % 4==0&&year%100!=0||year%400==0){
date+=29;
}else{
date+=28;
}
case 2:date+=31;
case 1:date+=day;
}
alert(year+"年"+month+"月"+day+"天是该年的第"+date+"天");
</script>
</body>
</html>